<template>
  <div class="one">
    <div class="one-one">
        <h3>分类</h3>
        <div class="one-two" v-for="item in tableData1" :key="item.id" @click="goToCategory(item.id,item.name)" style="cursor: pointer;">
            <img src="./img/微信图片_20251018104745_83_3.png" alt="">
            {{item.name}}</div>
    </div>
      <div class="one-three">
            <img  :src="tableData4.avatar" alt="">
            <h1>{{tableData4.author}}</h1>
            <span>{{tableData4.introduction}}</span>
        </div>
    
  </div>
</template>

<script>

export default {
  data(){
    return{
        tableData1:[],
        tableData4:[],
    }
  },
   created() {
   
    this.getList2();
    this.getList4();
    
  },
  methods:{
    goToCategory(categoryId,name) {

    
    this.$router.push(`/classify?id=${categoryId}`);
    localStorage.setItem("name",name)
   
    
  },
       getList2() {
      this.$axios
        .post(`/api/api/category/list`)
        .then((res) => {
          this.tableData1 = res.data.data;
          console.log(this.tableData1, "222222");
          console.log(res);
        })
        .catch((err) => {
          console.log(err);
        });
    },
     getList4() {
      this.$axios
        .post(`/api/api/blog/setting/detail`)
        .then((res) => {
          this.tableData4 = res.data.data;
          console.log(this.tableData4, "图片");
          console.log(res);
        })
        .catch((err) => {
          console.log(err);
        });
    },
  }
}
</script>

<style scoped>
.one{
   background-color: #f4f4f4;
   display: flex;
   justify-content: space-around;  
    align-items: flex-start; 
}
.one-one{
    width: 898px;
    background-color: white;
    font-size: 16px;
    margin-top: 20px;
    margin-left: 200px;

}
.one-two{
  width: 800px;
  height: 20px;
  padding: 8px 16px;
  display: flex;
  border-radius: 10px;
  /* margin-left: 30px; */

}
.one-two img{
  width: 16px;
  height: 16px;
  margin-right: 10px;
}
.one-two:hover{
  background-color: rgb(243 244 246);
  color: rgb(26 86 219);
}
.one-three{
     width: 283px;
  height: 185px;
  background-color: white;
  text-align: center;
  margin-top: 20px;
}
.one-three h1{
    margin: 0;
}
.one-three img{
    width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-top: 20px;
}

</style>